<template>
  <Card>
    <p slot="title">消防告警主机误判率</p>
    <div class="chart" id="chart-report-wrong"></div>
    <Divider />
    <span class="text">误判告警数:{{count}}个</span>
    <Spin v-show="loading" fix size="large" />
  </Card>
</template>

<script>
export default {
  name: "",
  data() {
    return {
      count: 0,
      loading: false,
      option: null
    };
  },
  methods: {
    renderChart() {
      this.loading = true;
      this.option = {
        legend: {
          data: ["误判告警", "已核实告警"],
          left: "center",
          top: "top",
          orient: "horizontal"
        },
        color: [this.COLORS[0], this.COLORS[4]],
        series: [
          {
            type: "pie",
            radius: ["35%", "50%"],
            center: ["50%", "50%"],
            itemStyle: {
              normal: {
                shadowColor: "#00000020",
                shadowBlur: 12,
                shadowOffsetX: 0,
                shadowOffsetY: 5
              }
            },
            label: {
              normal: {
                show: true,
                position: "outisde",
                formatter: "{b}:\n{c}条"
              }
            },
            data: [
              { name: "误判告警", value: 0 },
              { name: "已核实告警", value: 0 }
            ]
          }
        ]
      };
      this.$Crender('chart-report-wrong',this.option)
      this.loading = false;
    }
  },
  mounted() {
      this.renderChart();
  },
};
</script>

<style scoped>
.chart{
    height:410px;
}
</style>